(x_set_font): Handle case of x_new_fontset returning the
authorGerd Moellmann <gerd@gnu.org>
Thu, 1 Mar 2001 12:56:26 +0000 (12:56 +0000)
committerGerd Moellmann <gerd@gnu.org>
Thu, 1 Mar 2001 12:56:26 +0000 (12:56 +0000)
same name as before, although there was a change in fontsets.

src/xfns.c

index 2c3a16ce0191ef4200214782f1d8ae4b51de5170..58a965d985f408fd35e208e9515bccf1c04763ad 100644 (file)
@@ -1814,6 +1814,7 @@ x_set_font (f, arg, oldval)
   Lisp_Object result;
   Lisp_Object fontset_name;
   Lisp_Object frame;
+  int old_fontset = f->output_data.x->fontset;
 
   CHECK_STRING (arg, 1);
 
@@ -1831,8 +1832,16 @@ x_set_font (f, arg, oldval)
     error ("The characters of the given font have varying widths");
   else if (STRINGP (result))
     {
-      if (!NILP (Fequal (result, oldval)))
+      if (STRINGP (fontset_name))
+       {
+         /* Fontset names are built from ASCII font names, so the
+            names may be equal despite there was a change.  */
+         if (old_fontset == f->output_data.x->fontset)
+           return;
+       }
+      else if (!NILP (Fequal (result, oldval)))
        return;
+      
       store_frame_param (f, Qfont, result);
       recompute_basic_faces (f);
     }